<h1>Editing resource</h1>

<%= error_messages_for :resource %>

<% form_for(@resource) do |f| %>
  <p>
    <b>Title</b><br />
    <%= f.text_field :title %>
  </p>


  <p>
  video: <%= check_box_tag 'video' %>
  audio: <%= check_box_tag 'audio' %>
  text: <%= check_box_tag 'text' %>
  </p>

  <p>
    <b>Description</b><br />
    <%= f.text_area :description %>
  </p>

  <p>
    <b>Link</b><br />
    <%= f.text_field :link %>
  </p>

  <p>
    <%= f.submit "Update" %>
  </p>
<% end %>


	<!--	<div id = "tags">
			<b>Tags:</b>
    		<% tags = @resource.showResourceTags() %>
			<% for tag in tags %>
			<%= tag.name %> |
    		<%= link_to tag.name, :controller => "resources" , :action => "index" , :tag_id => tag.id %> | 
		<% end %>
		</div> --> 
		
	<b>Tags:</b>
	<% tags = @resource.showResourceTags() %>
	<% for tag in tags %>
   		<%= link_to  tag.name  , :action => 'show' ,:controller => 'tag_events' , :tag_id => tag.id , :res_id => @resource.id %>  
	<% end %>
		
<div id="tagEdit">  
</div>  

<%= link_to_remote 'Add Tag', 
			:url => {:action => "addTagToProfile2" , :controller => "tag_events" , :id => @resource.id}, 	
			:update => 'tagEdit' %>
			


<%= link_to 'Show', @resource %> |
<%= link_to 'Back', resources_path %>
